package com.hrm.pojo;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "t_depart")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Depart {
	private String id;
	private String names;
	private String englishnames;
	private List<Working> workerList;
	private List<Zhaopin> zhaopinList;
	private List<Salary> salaryList;
	
	@Id
	@GenericGenerator(name = "pk",strategy = "uuid")
	@GeneratedValue(generator = "pk")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getNames() {
		return names;
	}
	public void setNames(String names) {
		this.names = names;
	}
	@OneToMany(mappedBy = "depart")
	public List<Working> getWorkerList() {
		return workerList;
	}
	public void setWorkerList(List<Working> workerList) {
		this.workerList = workerList;
	}
	
	public String getEnglishnames() {
		return englishnames;
	}
	public void setEnglishnames(String englishnames) {
		this.englishnames = englishnames;
	}
	@ManyToMany
	@JoinTable(name = "t_depart_zhaopin",joinColumns = @JoinColumn(name = "zhaopinid"),inverseJoinColumns = @JoinColumn(name = "departid"))
	public List<Zhaopin> getZhaopinList() {
		return zhaopinList;
	}
	public void setZhaopinList(List<Zhaopin> zhaopinList) {
		this.zhaopinList = zhaopinList;
	}
	public List<Salary> getSalaryList() {
		return salaryList;
	}
	public void setSalaryList(List<Salary> salaryList) {
		this.salaryList = salaryList;
	}
	
	
}
